package Wuli_2023;

/**
 * 圆柱
 */
public  class cylinder extends geometry_3D {
    double r;  //半径
    double h; //高

    cylinder(double r, double h) {
        this.r = r;
        this.h = h;
    }
    @Override
    double getBottomS() {
        return new circle(r).getS(); //调用圆面积函数
    }
    @Override
    double getV() {
        return this.getBottomS()*h;
    }

}
